package com.shruijin.wy.proxy.statics;

import com.shruijin.wy.proxy.statics.service.ShopService;
import com.shruijin.wy.proxy.statics.service.UserService;

public class UserActionProxy {

    private  UserService userService;
    private ShopService shopService;

    public UserActionProxy(UserService userService){
        this.userService = userService;
    }

    public UserActionProxy(ShopService shopService){
        this.shopService = shopService;
    }

    public void setShopService(ShopService shopService){
        this.shopService = shopService;
    }

    public  void run(){
        if (null!=userService){
            userService.run();
        }
    }

    public void walk(){
        if (null!=userService){
            userService.walk();
        }
    }

    public void swim(){
        if (null!=userService){
            userService.swim();
        }
    }

    public void shopping(){
        if (null!=shopService){
            shopService.shop();
        }
    }


}
